package proyecto.modelo;

import java.io.Serializable;
import javax.persistence.*;

/**
 * The primary key class for the det_cartelera database table.
 * 
 */
@Embeddable
public class DetCarteleraPK implements Serializable {
	//default serial version id, required for serializable classes.
	private static final long serialVersionUID = 1L;

	@Column(name="co_cartelera")
	private int coCartelera;

	@Column(name="co_sala")
	private String coSala;

	@Column(name="co_cine")
	private String coCine;

	@Column(name="co_pelicula")
	private int coPelicula;

    public DetCarteleraPK() {
    }
	public int getCoCartelera() {
		return this.coCartelera;
	}
	public void setCoCartelera(int coCartelera) {
		this.coCartelera = coCartelera;
	}
	public String getCoSala() {
		return this.coSala;
	}
	public void setCoSala(String coSala) {
		this.coSala = coSala;
	}
	public String getCoCine() {
		return this.coCine;
	}
	public void setCoCine(String coCine) {
		this.coCine = coCine;
	}
	public int getCoPelicula() {
		return this.coPelicula;
	}
	public void setCoPelicula(int coPelicula) {
		this.coPelicula = coPelicula;
	}

	public boolean equals(Object other) {
		if (this == other) {
			return true;
		}
		if (!(other instanceof DetCarteleraPK)) {
			return false;
		}
		DetCarteleraPK castOther = (DetCarteleraPK)other;
		return 
			(this.coCartelera == castOther.coCartelera)
			&& this.coSala.equals(castOther.coSala)
			&& this.coCine.equals(castOther.coCine)
			&& (this.coPelicula == castOther.coPelicula);

    }
    
	public int hashCode() {
		final int prime = 31;
		int hash = 17;
		hash = hash * prime + this.coCartelera;
		hash = hash * prime + this.coSala.hashCode();
		hash = hash * prime + this.coCine.hashCode();
		hash = hash * prime + this.coPelicula;
		
		return hash;
    }
}